/*
 * @lc app=leetcode.cn id=1952 lang=javascript
 *
 * [1952] 三除数
 */

// @lc code=start
/**
 * @param {number} n
 * @return {boolean}
 */
var isThree = function (n) {
  let sum = 0;
  for (let i = 1; i <= n >> 1; i++) {
    sum += +(n % i === 0);
    if (sum > 2) return false;
  }
  return sum === 2;
};
// @lc code=end

